#include<cmath>
using namespace std;
int main()
{int n,a[1000], b[100],m;
 cin>>n;
 for(int i=1;i<=n;i++)
 {cin>>a[i];
  if(a[i]<10)  {cout<<a[i]<<endl;continue;}
  for(int j=1;;j++)
    {b[j]=a[i]%10;
     a[i]=a[i]/10;
     if(a[i]==0)   {m=j;break;}
     }
  if(b[m]>=5) {int sum=1;
                       for(int k=1;k<=m;k++)
                            sum*=10 ;
                          cout<<sum<<endl;
               }
  for(int 
